package oop.ex2.tokenizer;

/**
 * This is the base class for all the analyzers that search for functions.
 * It enforces the specification that the function name must be followed by a curly bracket.
 * @author daniel_i_l
 *
 */
public abstract class FunctionAnalyzer extends TokenAnalyzer {
	private static final String START_PATTERN = "\\{";
	private String _functionName;
	
	/**
	 * Create a function analyzer that looks for a specific function name.
	 * @param functionName The function name to look for.
	 */
	public FunctionAnalyzer(String functionName) {
		super(functionName + START_PATTERN);
		_functionName = functionName;
	}
	
	/**
	 * Get the function name.
	 * @return The function name.
	 */
	public String getFunctionName()
	{
		return _functionName;
	}
}
